//
//  BanKaHeadView.m
//  PosApp
//
//  Created by 刘萍 on 2018/9/7.
//  Copyright © 2018年 李英新. All rights reserved.
//

#import "BanKaHeadView.h"
#import "BannerModel.h"

@implementation BanKaHeadView

- (void)CreateOneControllerHead01{
    
    if (!_scrollView) {
        _scrollView = [YX3DBannerView initWithFrame:CGRectMake(0, 10, KScreenW, 180) imageSpacing:10 imageWidth:KScreenW-40];
        _scrollView.initAlpha = 0.2;
        _scrollView.imageRadius = 10;
        _scrollView.showPageControl = YES;
        _scrollView.curPageControlColor = [UIColor colorWithRed:246/255.0 green:86/255.0 blue:43/255.0 alpha:1];
        _scrollView.otherPageControlColor = [UIColor colorWithRed:246/255.0 green:86/255.0 blue:43/255.0 alpha:0.3];;
        _scrollView.autoScrollTimeInterval = 2;
        _scrollView.autoScroll = YES;
        _scrollView.imageHeightPoor = 10;
        _scrollView.placeHolderImage = [UIImage imageNamed:@"MainZWImage"];
        [self.BannerView addSubview:_scrollView];
    }
    //    self.scrollView.data = @[@"http://d.hiphotos.baidu.com/image/pic/item/b7fd5266d016092408d4a5d1dd0735fae7cd3402.jpg",@"http://h.hiphotos.baidu.com/image/h%3D300/sign=2b3e022b262eb938f36d7cf2e56085fe/d0c8a786c9177f3e18d0fdc779cf3bc79e3d5617.jpg",@"http://a.hiphotos.baidu.com/image/pic/item/b7fd5266d01609240bcda2d1dd0735fae7cd340b.jpg",@"http://h.hiphotos.baidu.com/image/pic/item/728da9773912b31b57a6e01f8c18367adab4e13a.jpg",@"http://h.hiphotos.baidu.com/image/pic/item/0d338744ebf81a4c5e4fed03de2a6059242da6fe.jpg"];
    
    _scrollView.clickImageBlock = ^(NSInteger currentIndex) {
        NSLog(@"点击的第%ld个banner",currentIndex);
        //        [self.delegate ClickOnBannerWithIndex:currentIndex];
    };
}

- (void)AddBannerImage:(NSArray *)BannerArr{
    
    NSMutableArray * ImageArr = [[NSMutableArray alloc] init];
    for (int i = 0; i < BannerArr.count; i ++) {
        BannerModel * model = BannerArr[i];
        [ImageArr addObject:model.plug_src];
    }
    self.scrollView.data = ImageArr;
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

@end
